<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:s="http://jboss.org/schema/seam/taglib"
      xmlns:a="http://richfaces.org/a4j">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>商家注册</title>
	<link href="css/screen.css" rel="stylesheet" type="text/css" />
</h:head>

<body id="pgHome">

<div id="document">

	<div id="header">
		<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
	</div>
	
	<div id="container">
	
		<div id="sidebar">		    
			<h1>Integrated multi-layer validation</h1>
			<p>
			    Robust applications need data validation in several different places. Seam integrates Hibernate Validator,
			    a set of annotations for expressing data model constraints in your domain model classes. Then, these 
			    constraints are applied almost completely transparently at three levels of the application: by Seam when 
			    the user first enters data, by EJB before persisting data to the database, and, if you use Hibernate to 
			    generate your database schema, by the database constraints themselves. Multi-layer validation hardens
			    your application and protects your data. Even better, it's self-documenting, and easy to change when
			    your business rules change.
			</p>
			<p>
			   <a href="#" onclick="window.open('exp/registerExp.html','exp','width=752,height=500,scrollbars=yes');">
			      What happens when I register?
			   </a>
			</p>
		</div>
		
		<div id="content">
		
			<div class="section">
				<h1>Register</h1>
			</div>
			
			<div class="section">
                
				<div class="entry errors">
					<h:messages id="messages" globalOnly="true"/>
				</div>

                <h:form id="registration">
				<fieldset>
				
					<s:decorate id="usernameDecorate" template="edit.xhtml">
						<ui:define name="label">用户名:</ui:define>
						<h:inputText id="username" value="#{seller.name}" required="true">
							<a:ajax event="blur" render="usernameDecorate"/>
						</h:inputText>
					</s:decorate>
					
					<s:decorate id="passwordDecorate" template="edit.xhtml">
						<ui:define name="label">密码:</ui:define>
						<h:inputSecret id="password" value="#{seller.pwd}" required="true"/>
					</s:decorate>
					
					<s:decorate id="verifyDecorate" template="edit.xhtml">
						<ui:define name="label">重复密码:</ui:define>
						<h:inputSecret id="verify" value="#{register.verify}" required="true"/>
					</s:decorate>
					
					<s:decorate id="displayNameDecorate" template="edit.xhtml">
						<ui:define name="label">店名:</ui:define>
						<h:inputText id="displayName" value="#{seller.displayName}" required="true"/>
					</s:decorate>
					
					<s:decorate id="addressDecorate" template="edit.xhtml">
						<ui:define name="label">地址:</ui:define>
						<h:inputText id="address" value="#{seller.address}" required="true"/>
					</s:decorate>
					
					<s:decorate id="telDecorate" template="edit.xhtml">
						<ui:define name="label">电话:</ui:define>
						<h:inputText id="tel" value="#{seller.tel}" required="true"/>
					</s:decorate>
					
					<s:decorate id="descriptionDecorate" template="edit.xhtml">
						<ui:define name="label">店家简介:</ui:define>
						<h:inputText id="description" value="#{seller.description}" required="false"/>
					</s:decorate>
					
					<s:decorate id="deliveryKeyDecorate" template="edit.xhtml">
						<ui:define name="label">派送范围:</ui:define>
						<h:inputText id="deliveryKey" value="#{seller.deliveryKey}" required="false"/>
					</s:decorate>
					
					<div class="buttonBox">
						<h:commandButton id="register" value="提交" action="#{register.registerSeller}"/>
						&#160;
						<s:button id="cancel" value="取消" view="/home.xhtml"/>
					</div>
									
				</fieldset>
                </h:form>
                
			</div>
			
		</div>
		
	</div>
	
	<div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra) and Facelets</div>
	
</div>

</body>

</html>
